package com.atguigu.controller;


import com.atguigu.service.StatisticsDailyService;
import com.atguigu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/staservice/sta")
@CrossOrigin
public class StaController {
    @Autowired
    private StatisticsDailyService service;

    @GetMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day){
        service.registerCount(day);
        return R.ok();
    }

    //图标数据返回
    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,
                      @PathVariable String begin,
                      @PathVariable String end){
        Map<String,Object> map = service.getShowData(type,begin,end);
        return R.ok().data(map);
    }

}
